package com.mspbots.api.service.impl;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.mspbots.api.service.TenantTicketService;
import com.mspbots.cw.request.TenantTicketDTO;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;

import java.util.List;
import java.util.Map;

/**
 * @ClassName com.mspbots.api.service.impl.TenantTicketServiceImpl
 * @Description TODO
 * @Author Jun
 * @Date 2019/8/14 16:16
 * @Version 1.0
 **/
@Deprecated
@Service
public class TenantTicketServiceImpl extends BaseGenericService implements TenantTicketService {


    @Override
    public List<TenantTicketDTO> findList(Map<String, Object> params) {
        Mono<JsonNode> resultMono = this.apiClient.get("/tickets/list-for-rule", params);
        JsonNode result = resultMono.block();
        return this.objectMapper.convertValue(result, new TypeReference<List<TenantTicketDTO>>() {
        });
    }


}
